package gt

import (
	"github.com/go-resty/resty/v2"
	"github.com/tidwall/gjson"
)

//获得当前公网ip
func GetPubIP() (pubIp string) {

	url1 := `http://ip-api.com/json/?lang=zh-CN`
	hc := resty.New()
	res, err := hc.R().Get(url1)
	CheckError(err)

	pubIp = gjson.Get(Bytes2str(res.Body()), "query").String()
	return pubIp

}
